
#import "EMErrorDescription.h"
#import <appkit/appkit.h>

@implementation EMErrorDescription

//--------------------------------------------------------------------------------
// INITIALISIERUNG
//--------------------------------------------------------------------------------

- init
	{
	[super init];
	severity=EMSeverityUnknown;
	exceptionClass=NXUniqueString("unknown");
	return self;
	}
	

//--------------------------------------------------------------------------------
// ARCHIVIERUNG
//--------------------------------------------------------------------------------

- write:(NXTypedStream *)stream;
	{
	[super write:stream];
	NXWriteTypes(stream,"i%@*",&severity,&exceptionClass,&actions,&msg);
	return self;
	}
	
	
- read:(NXTypedStream *)stream;
	{
	[super read:stream];
	NXReadTypes(stream,"i%@*",&severity,&exceptionClass,&actions,&msg);
	return self;
	}

	
//--------------------------------------------------------------------------------
// INSTANCE VAR METHODEN
//--------------------------------------------------------------------------------

- setSeverity:(EMErrorSeverity)value;
	{
	severity=value;
	return self;
	}


- (EMErrorSeverity)severity;
	{
	return severity;
	}

	
	
- setExceptionClass:(const char *)aClassName;
	{
	exceptionClass=NXUniqueString(aClassName);
	return self;
	}


- (NXAtom)exceptionClass;
	{
	return exceptionClass;
	}


- addAction:(EMErrorAction *)anObject;
	{
	if(!actions)
		actions=[[List allocFromZone:[self zone]] init];
	[actions addObject:anObject];
	return self;
	}
	

- setActions:(List *)aList;
	{
	[actions free];
	actions=aList;
	return self;
	}
	

- actions;
	{
	return actions;
	}



- setMsg:(const char *)text;
	{
	msg=NXCopyStringBufferFromZone(text,[self zone]);
	return self;
	}

	
- (const char *)msg;
	{
	return msg;
	}


//--------------------------------------------------------------------------------
// THAT'S IT
//--------------------------------------------------------------------------------

@end
